package com.gzx.plugin.tjzy.feign.debtor.controller;

import com.gzx.plugin.tjzy.feign.debtor.service.GzxDebtorInfoFeignService;
import com.gzx.tjzy.feign.req.debtor.GzxDebtorInfoReqDto;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zjt
 * @description
 * @date 2025/2/13 10:04
 */
@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/feign/tjzy/debtor")
public class GzxDebtorInfoFeignController {

    private final GzxDebtorInfoFeignService debtorInfoFeignService;

    /**
     * 欠款人信息数据同步
     *
     * @param debtorInfoReqDtoList
     */
    @RequestMapping("/sync")
    public void sync(@RequestBody List<GzxDebtorInfoReqDto> debtorInfoReqDtoList) {
        log.info("欠款人信息数据同步开始......{}", debtorInfoReqDtoList);
        debtorInfoFeignService.insertBatch(debtorInfoReqDtoList);
    }
}
